Defer useDeferredValue updates in Gestures#35511
Merged
sebmarkbage merged 1 commit intofacebook:mainfrom Jan 16, 2026
Merged
Conversation
Contributor
Author
|
I'm not actually sure this is better because the "previous" state is kind of arbitrary in these simulated environments. If you did an actual Transition at the end then that would not include this deferred value and you'd typically not see this state for those. But I think in the case where something is structured in such a way that you do have a shared deferred value that updates it probably makes sense to treat that similar to if you did a sync navigation since that's effective what the gesture has to be. |
|
Comparing: 4a3d993...9ab381c Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
acdlite
approved these changes
Jan 16, 2026
github-actions bot
pushed a commit
that referenced
this pull request
Jan 16, 2026
If an initial value is specified, then it's always used regardless as part of the gesture render. If a gesture render causes an update, then previously that was not treated as deferred and could therefore be blocking the render. However, a gesture is supposed to flush synchronously ideally. Therefore we should consider these as urgent. The effect is that useDeferredValue renders the previous state. DiffTrain build for [eac3c95](eac3c95)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If an initial value is specified, then it's always used regardless as part of the gesture render.
If a gesture render causes an update, then previously that was not treated as deferred and could therefore be blocking the render. However, a gesture is supposed to flush synchronously ideally. Therefore we should consider these as urgent.
The effect is that useDeferredValue renders the previous state.